import type { MapFeatures } from '@/map'
import { getEntity } from '../base'
import { highLightRoutingFeatures, type Routing } from '../routing'
import type { FlightPlan } from './types'

export function highlightFlightPlanFeatures(fpl: FlightPlan): MapFeatures | null {
  const routing = getEntity<Routing>('Routing', fpl.routing)
  if (!routing) {
    return null
  }
  return highLightRoutingFeatures(routing)
}
